home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_inf_wheel_zapdead.cog < prev    next >
Text File  |  1999-11-15  |  4KB  |  126 lines

  1. # Jones 3D Cog Script
  2. #
  3. # INF_IMP1_Pistons.cog
  4. # This is the generic door with a camera attached
  5. #
  6. # [SXC]
  7. #
  8. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13.     message     startup
  14.     message     user0
  15.     message     pulse
  16.     message     entered
  17.     
  18.     thing       player                                      local
  19.     
  20.     thing       source0
  21.     thing       source1
  22.     thing       source2
  23.     thing       source3
  24.     thing       source4
  25.     thing       source5
  26.     
  27.     thing       target0
  28.     thing       target1
  29.     thing       target2
  30.     thing       target3
  31.     thing       target4
  32.     thing       target5
  33.     
  34.     sector      dedsector
  35.     
  36.     thing       lightning_strike                            local
  37.     thing       strike_sector                               local
  38.     
  39.     template    sparks=bluesparks                              local
  40.     template    smoke0=+pistol_smoke1                        local
  41.     template    lightzap=+lightningzap                        local
  42.     template    lighthit=+lightninghit                        local
  43.     
  44.     material    lightningmat0=inf_4sfx_lightning_a.mat        local
  45.     material    lightningmat1=inf_4sfx_lightning_b.mat        local
  46.     material    lightningmat2=inf_4sfx_lightning_c.mat        local
  47.     material    lightningmat3=inf_4sfx_lightning_d.mat        local
  48.         
  49.     int         pulsetime=2                                 local
  50.     int         cnt=0                                       local
  51.     int         count                                       local
  52.     int         solved=0                                    local
  53.     
  54.     sound        contact=gen_lightning_contact_c.wav            local
  55.     
  56.     vector      player_pos                                  local
  57.     
  58.       
  59. end
  60.  
  61.  
  62. code
  63.  
  64. #........................................................................................
  65.  
  66. startup:
  67.     //inital conditions
  68.     player = GetLocalPlayerThing();
  69.     
  70. return;
  71.  
  72. #........................................................................................
  73.  
  74. user0:
  75.     //print("pool is armed");
  76.     SetPulse(0.5);
  77.     solved = 1;
  78.     
  79. return;
  80.  
  81. #........................................................................................
  82.  
  83. pulse:
  84.     //lightning strikes
  85.     count = RandBetween(0, 5);
  86.     PlaySoundThing(contact, source0[count], 1, 2, 10, 0x0080);
  87.     for (cnt = 4; cnt <= RandBetween(4, 8); cnt = cnt + 1)
  88.     {
  89.         lightning_strike = CreatePolylineThing(source0[count], target0[count], '0 0 0', lightningmat0[RandBetween(0, 3)], 0.05, 0.05, 0.05);
  90.         Sleep(0.025); 
  91.     }
  92.         
  93. return;
  94.  
  95. #........................................................................................
  96.  
  97. entered:
  98.     //kill the player for a bad move
  99.     if ((GetSenderRef() == dedsector) && (GetSourceRef() == player) && (solved == 1))
  100.     {
  101.     
  102.         //print("indy gets hit");
  103.         SetActorFlags(player, 0x200000);
  104.         StopThing(player);
  105.         player_pos = VectorAdd(GetThingPos(player), '0 0 0.05');
  106.         for (cnt = 4; cnt <= RandBetween(4, 8); cnt = cnt + 1)
  107.         {
  108.             CreatePolylineThing(source0[cnt], player_pos, '0 0 0', lightningmat0[RandBetween(0, 3)], 0.05, 0.05, 0.05);
  109.             Sleep(0.05); 
  110.         }
  111.         CreateThingAtPos(sparks, GetThingSector(player), player_pos, '0 0 0');
  112.         CreateThingAtPos(lighthit, GetThingSector(player), player_pos, '0 0 0');
  113.         //print("damaging player");
  114.         DamageThing(player, 1000, 0x2, source0[cnt]);
  115.         Sleep(1);
  116.         ClearActorFlags(player, 0x200000);
  117.         
  118.     }
  119.     
  120. return;
  121.  
  122. #........................................................................................
  123. end
  124.  
  125.  
  126.